//
//  WXBookModel.m
//  WXReader
//
//  Created by Andrew on 2018/5/27.
//  Copyright © 2018年 Andrew. All rights reserved.
//

@implementation TL_ProductionModel

+ (NSDictionary<NSString *,id> *)modelContainerPropertyGenericClass{
    return @{
//             @"chapter_list" : [TL_ProductionChapterModel class],
//             @"list" : [TL_ProductionChapterModel class]
             };
}

+ (NSDictionary *)modelCustomPropertyMapper {
    return @{
            @"cover":@[@"bg_image",@"cover"],
             @"production_descirption"  :@"description",
             @"visited"             :@"view",
             @"record_title"        :@"chapter_title",
             @"production_id"       :@[@"book_id", @"comic_id", @"audio_id"],
             @"name"                :@[@"name", @"book_name", @"comic_name", @"audio_name",@"cat_name"],
             @"total_chapters"      :@[@"total_chapters", @"total_chapter"],
             @"reading_chapter_id" : @"chapter_id"
             };
}



+ (NSDictionary *)mj_replacedKeyFromPropertyName {
    return @{
         @"cover":@"coverPic",
         @"production_descirption"  :@"description",
         @"visited"             :@"viewNum",
         @"production_id"       :@"worksId",
         @"name"                :@"worksName",
         @"favors" : @"collectNum",
         @"last_chapter" : @"latestChapterName",
         @"total_comment" : @"commentNum",
         @"last_chapter_time" : @"updateTime",
         @"record_title":@"chapterName",
         @"reading_chapter_id":@"chapterId",
         @"tag":@"categoryList",
         @"book_tags":@"osTagList",
         @"total_chapters":@"totalChapters",
    };
}
+ (NSDictionary *)mj_objectClassInArray{
    return @{
        @"osCommentList" : @"TL_CommentsDetailModel",
        @"chapter_list"  : @"TL_ProductionChapterModel",
        @"categoryList"  : @"TL_TagModel",
        @"osTagList"  : @"TL_TagModel",
    };
}
- (id)copyWithZone:(NSZone *)zone {
    return [self modelCopy];
}

- (NSString *)production_descirption
{
    _production_descirption = [_production_descirption stringByReplacingOccurrencesOfString:@"\r" withString:@""];
    return _production_descirption;
}

- (BOOL)isEqual:(id)object {
    if (![object isKindOfClass:self.class]) return NO;
    return [self hash] == [object hash];
}

- (NSUInteger)hash {
    return [self modelHash];
}
- (NSString *)author_name{
    if (!_author_name) {
        _author_name = _author;
        
    }
    return _author_name;
}

@end
